package com.hksj.Intelligentmanagement.controller;

import com.hksj.Intelligentmanagement.common.Result;
import com.hksj.Intelligentmanagement.service.CockpitScreenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @ClassName CockpitScreenController
 * @Description TODO
 * @Author @陈章
 * @Date 2023/5/5 15:52
 * @Version 1.0
 */
@Api(tags = "驾驶舱信息")
@RestController
@RequestMapping("/api/surgicalInfo")
public class CockpitScreenController {

    @Autowired
    private CockpitScreenService cockpitScreenService;

    /**
     * 查询所有手术信息
     *
     * @return
     */
    @ApiOperation(value = "查询所有手术信息 ")
    @PostMapping("todaySurgicalVolume")
    public Result todaySurgicalVolume() {
        Map map = cockpitScreenService.todaySurgicalVolume();
        return Result.ok(map);
    }

    /**
     * 待排班手术
     *
     * @return
     */
    @ApiOperation(value = "待排班手术")
    @PostMapping("queryListSurgeryToBeScheduled")
    public Result queryListSurgeryToBeScheduled() {
        Map<String, Object> map = cockpitScreenService.queryListSurgeryToBeScheduled();
        return Result.ok(map);
    }


    /**
     * 已手术台数医生排名
     *
     * @return
     */
    @ApiOperation(value = "已手术台数医生排名")
    @PostMapping("rankingOfSurgeons")
    public Result rankingOfSurgeons(String type) {
        List<Map<String, Object>> list = cockpitScreenService.rankingOfSurgeons(type);
        return Result.ok(list);
    }


}
